﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace XEvents.Library
{
    internal struct dm_xe_map_values
    {
        internal string name;
        internal Guid object_package_guid;
        internal int map_key;
        internal string map_value;

        internal dm_xe_map_values(SqlDataReader dr)
        {
            name = (dr["name"] == DBNull.Value ? string.Empty : dr["name"]).ToString();
            Utilities.IsGuid((dr["object_package_guid"] == DBNull.Value ? string.Empty : dr["object_package_guid"]).ToString(), out object_package_guid);
            Int32.TryParse((dr["map_key"] == DBNull.Value ? "-1" : dr["map_key"]).ToString(), out map_key);
            map_value = (dr["map_value"] == DBNull.Value ? string.Empty : dr["map_value"]).ToString();
        }
    }
}
